package com.ruoyi.crm.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseFlowEntity;
import com.ruoyi.crm.domain.dto.FlowHisTaskDTO;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 费用申请对象 crm_fee_apply
 *
 * @author yanwenliang
 * @date 2024-10-28
 */
@Data
@TableName("crm_fee_apply")
public class CrmFeeApply extends BaseFlowEntity {
    private static final long serialVersionUID = 1L;

    /** 申请id */
    @TableId(type = IdType.ASSIGN_ID)
    private String applyId;

    /**
     * 费用名称
     */
    private String applyName;

    /** 客户ID */
    @Excel(name = "客户ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String customerId;

    /** 商机订单ID */
    @Excel(name = "商机订单ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String orderId;

    /** 是否核销 */
    @Excel(name = "是否核销")
    private String isAdjust;

    /** 小组id */
    @Excel(name = "小组id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String groupId;

    /** 部门id */
    @Excel(name = "部门id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String deptId;

    /** 申请日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date applyTime;

    /** 合计金额 */
    @Excel(name = "合计金额")
    private BigDecimal amount;

    /** 原借款 */
    @Excel(name = "原借款")
    private BigDecimal loan;

    /** 应退款 */
    @Excel(name = "应退款")
    private BigDecimal refund;

    /** 所属人id */
    @Excel(name = "所属人id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String userId;

    /**
     * 审核记录
     */
    private String auditStatus;

    /**
     * 费用归属
     */
    private String applyAscription;

    /** 删除标志(0 未删除 1 删除) */
    @TableLogic
    private String delFlag;

    /**
     * 费用明细详情
     */
    @TableField(exist = false)
    private List<CrmFeeApplyDetails> detailList;

    /**
     * 审批记录
     */
    @TableField(exist = false)
    private List<FlowHisTaskDTO> hisTaskList;

    /**
     * 客户名称
     */
    @Excel(name = "客户名称")
    @TableField(exist = false)
    private String customerName;

    /**
     * 商机名称
     */
    @Excel(name = "商机名称")
    @TableField(exist = false)
    private String orderName;

    /**
     * 部门名称
     */
    @Excel(name = "部门名称")
    @TableField(exist = false)
    private String deptName;

    @TableField(exist = false)
    private String userName;

}
